package cn.xxliang.platapp.controller;

import cn.xxliang.platapp.common.BaseRespWithData;
import cn.xxliang.platapp.pojo.dto.AppSystemProductReDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import cn.xxliang.platapp.pojo.query.AppSystemProductReQuery;

@RestController
@RequestMapping("/appSystemProductRe")
@Api(tags = "应用-产品关系管理")
@Validated
public class AppSystemProductReController {

    @PostMapping("/add")
    @ApiOperation("添加关系")
    public BaseRespWithData add(@RequestBody @Valid AppSystemProductReDto dto) {
        return new BaseRespWithData().code(200).msg("添加成功");
    }

    @GetMapping("/get")
    @ApiOperation("查询关系")
    public BaseRespWithData get(@RequestParam @NotNull(message = "主键不能为空") String appSystemProductId) {
        return new BaseRespWithData().code(200).msg("查询成功");
    }

    @GetMapping("/delete")
    @ApiOperation("删除关系")
    public BaseRespWithData delete(@RequestParam @NotNull(message = "主键不能为空") String appSystemProductId) {
        return new BaseRespWithData().code(200).msg("删除成功");
    }

    @PostMapping("/update")
    @ApiOperation("更新关系")
    public BaseRespWithData update(@RequestBody @Valid AppSystemProductReDto dto) {
        return new BaseRespWithData().code(200).msg("更新成功");
        
    }

    @PostMapping("/list")
    @ApiOperation("查询应用-产品关系列表,创建产品的的时候使用；")
    public BaseRespWithData list(@RequestBody @Valid String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功").data("Map<'xxxx':list<appSystemProductRe>>");
    
    }
}